#include<bits/stdc++.h>
using namespace std;
int main(){
	int a;
	bool first=1;
	string b;
	cin >> a >> b;
	for(int i = 0;i < b.size();i++){
		if(b[i] != '0'){
			if(first != 1)    cout << "+";
			cout << b[i] << "*" << a << "^" << b.size()-i-1;
			first=0;
		}
	}
	return 0;
}


